/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.google.code.jmarias.server.comparator;

import com.google.code.jmarias.common.Card;
import java.util.Comparator;

/**
 *
 * @author josef
 */
public class JustValueComparator implements Comparator<Card> {

    public int compare(Card cardA, Card cardB) {
        int cardValueA = cardA.getValue().ordinal();
        int cardValueB = cardB.getValue().ordinal();
        if (cardValueA == 3) {
            cardValueA = 8;
        }
        if (cardValueB == 3) {
            cardValueB = 8;
        }
        if (cardValueA == 7) {
            cardValueA = 9;
        }
        if (cardValueB == 7) {
            cardValueB = 9;
        }
        return cardValueA - cardValueB;
    }
}
